Repository navigation
Conversation
…functions angleToRotationFrameIndex and updateProjectileHeightAndCollision are built with /GL so their callers see their register use, and IgniteFireAtMiniTile is built with /GL with getFireEntityIDAtTile made visible to it. Taken from draft sourcehold#527. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
From draft sourcehold#527. Measured 100.0% raw on main 46f21c5. Status: SHC_3BB0A8C1_0x00402180 | 100.0% | Reimplemented Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
From draft sourcehold#527. Measured 100.0% raw on main 46f21c5. Status: SHC_3BB0A8C1_0x00402BD0 | 100.0% | Reimplemented Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
From draft sourcehold#527. Measured 100.0% raw on main 46f21c5. Status: SHC_3BB0A8C1_0x004036F0 | 100.0% | Reimplemented Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…00.0% From draft sourcehold#527. Measured 98.5% raw / 94.4% normalized on main 46f21c5; the only differences are the float constant labels and the _CIcos/_CIsin call targets. Status: SHC_3BB0A8C1_0x00403A20 | 100.0% | Reimplemented (counted: only float constant names and the CRT math helpers (_CIcos, _CIsin) differ) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
From draft sourcehold#527. Measured 99.7% raw / 94.9% normalized on main 46f21c5; the only differences are the float constant labels and the _CIcos/_CIsin call targets. Status: SHC_3BB0A8C1_0x00403FF0 | 100.0% | Reimplemented (counted: only float constant names and the CRT math helpers (_CIcos, _CIsin) differ) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
From draft sourcehold#527. Measured 100.0% raw on main 46f21c5. Status: SHC_3BB0A8C1_0x004052E0 | 100.0% | Reimplemented Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
From draft sourcehold#527. Measured 100.0% raw on main 46f21c5. Status: SHC_3BB0A8C1_0x00405DA0 | 100.0% | Reimplemented Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…on 100.0% From draft sourcehold#527. Measured 100.0% raw on main 46f21c5. Status: SHC_3BB0A8C1_0x004081E0 | 100.0% | Reimplemented Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
From draft sourcehold#527. Measured 100.0% raw on main 46f21c5. Status: SHC_3BB0A8C1_0x004087C0 | 100.0% | Reimplemented Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
|
Match regression check 1 of the 10 status entries behind the files this PR changes are below the best match already known on
Percentages are read from the |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
From draft sourcehold#527. Measured 68.2% raw / 68.2% normalized on main 592a17d. The original keeps 0 in edi: it compares against edi instead of 0, stores di for 0, builds 3 as lea edx, [edi + 3], and pushes/pops edi. Ours uses immediates and test reg, reg, and pops esi before the jump table. Block order, stores and computation are the same, so nothing differs in behaviour. Status: SHC_3BB0A8C1_0x00402900 | 68.2% | Register allocation differs Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
Names the five values of Entity::pathAxisCase, the axis a projectile's Bresenham walk steps along: none, vertical (dX == 0), horizontal (dY == 0), Y-major and X-major. Used by initializeProjectileVelocities and handleProjectileWallBounce. PathAxisCaseShort is the sized alias for the short field; the field itself keeps its generated type. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
- PathAxisCase names for pathAxisCase, MC_MAP_XY_LIMIT(_INCLUSIVE) for the map bounds, and the Logic1 flags written inline instead of a local enum in IgniteFireAtMiniTile. - Map::Enums:: qualified now that Map::Entities::Enums exists. - Dropped redundant casts: whole-expression (short) on stores to short fields, (short)/(double) on call arguments, (byte) before & masks, the function-pointer cast on EntityCallbacks, and the char-pointer read of the random number's second byte (now >> 8). - short instead of word for graphicRotationUnk, fireParameter instead of two. - Removed code comments that explained match-driven forms (moved to the PR thread) and comments that restated the code. All 10 functions measure as before: 9 at 100% (two counted), UpdateFlag_1_2_4_Entity 68.2%. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
|
These forms are kept because the match needs them. I measured each one with a full build and reccmp, with both resolver sets on.
Not changed, because a header would have to change (main's generated headers lead):
|
…7-matched PathAxisCaseShort.hpp is taken from main (main's typedef is int, size 4); nothing uses it. compiler-flags-gl.txt keeps main's UpdateSlinger line and this PR's IgniteFireAtMiniTile line. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…BILITY_UNITS on The default build (visibility units off) gives 94.2 / 90.0: without the wrapper unit the original's reload of BuildingLayer[tile] after getFireEntityIDAtTile becomes a stack spill. With OPENSHC_FUNCTION_VISIBILITY_UNITS on it is 100.0 / 100.0. Same convention as main's other visibility-unit functions. No other function of this PR changes with the option. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
# Conflicts: # cmake/compiler-flags-gl.txt
…flow Flip the sub-tile coordinates in an if/else-if chain, then pick the shift pair with one test for the south and north orientations. Still 100.0% raw and normalized. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
The float constants and CRT helpers now pair through reccmp/float-literals.csv, so the counted remark is no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
|
Goto pass. The
Scores are quick_diff ratios (goto form 0.9909 for
Both functions stay at 100.0 / 100.0 with the gotos. Systematic flag pass.
Why none of them match. Every goto-free form compiles to the same instructions as the goto form; only the block layout differs.
Casts kept after the cast pass (c5794c6; every other cast was removed with identical code and warnings):
|
The 0.75 and 15.0 constants now pair through reccmp/float-literals.csv, so the counted remark is no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
Each removed cast leaves the generated code and the warnings unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
This PR takes 10 functions of draft #527 (
reimpl/entities-projectiles-fire):IgniteFireAtMiniTileat 100% only withOPENSHC_FUNCTION_VISIBILITY_UNITSon (94.2% in the default build);UpdateFlag_1_2_4_Entity, where only register allocation differs (see below).The other 7 functions of #527 stay in the draft.
Measured on
origin/main(46f21c5), and again after merging main 592a17d with the same results:reimpl/pr527-matchedwas cut from that commit and the files were taken from the draft's head (daf0c69).activateProjectileEntity,deleteEntity,getFireEntityIDAtTile,markEntityDestroyed, ...), which are measuring-only and not part of this PR.Entities::UpdateEntity_CowFlyingEntityState::angleToRotationFrameIndexEntityState::calculateEntityDrawOffsetEntityState::initializeProjectileVelocitiesEntityState::handleProjectileWallBounceEntities::IgniteFireAtMiniTile94.2% | 100.0 with OPENSHC_FUNCTION_VISIBILITY_UNITS onEntityState::spawnProjectileImpactDebrisEntityState::updateProjectileHeightAndCollisionEntityState::updateEntitiesEntities::UpdateFlag_1_2_4_EntitySince main's
reccmp/float-literals.csv,handleProjectileWallBounceandinitializeProjectileVelocitiesscore a plain 100.0.UpdateFlag_1_2_4_Entityis register allocation only. The original keeps the constant 0 inedi:edi, storesdifor 0, and builds 3 aslea edx, [edi + 3];edi.Ours uses immediates and
test reg, reg, and popsesiearlier. Block order, stores and computation are identical, so nothing differs in behaviour.The other 7 functions of the draft fail the register-blind check. Each has at least one non-allocation difference:
moveProjectileEntity: an extrajmpover loop-alignment padding, and different x87 instruction forms.spawnProjectileEntity: field store order, ajmp, and an indirect call.UpdateFireEntity: different tail-merge points.processSeaGulls: a duplicatedret, CSE'd loads, andmovzxvsmov.processEntityHitBuildingOrUnit: branch layout,add -10vssub 10, and different addressing modes.computeLineOfSightDistance: missing branches, andleavssub.math_atan_1: constant folding and x87 instruction selection.Style pass, following
REIMPLEMENTATION_STYLE_GUIDE.mdon main:.func.hppis the first include. UnneededMap.func.hppincludes and the unusedusingdeclarations are dropped.Enums::NM_*(NeighbourMask) for the wall-neighbour masks inhandleProjectileWallBounceandspawnProjectileImpactDebris.Enums::MO_*incalculateEntityDrawOffset.LogicHelpers::L_*for the non-flammable tile mask andL_TREEinIgniteFireAtMiniTile.ET_UNKNOWN_30andEntityTypeInt__ET_EXPLOSION.param_N, plus++/--/+=/*=self-operations.MC_MAP_XY_LIMIT(_INCLUSIVE)used for the map bounds.PathAxisCaseenum (src/OpenSHC/Map/Entities/Enums/PathAxisCase.hpp) is used forpathAxisCase. It is on main now through 0701799.UpdateEntity_CowFlying, thegotos) are explained in the PR thread, not in code comments.Header changes: none.
PathAxisCase.hppandPathAxisCaseShort.hppare on main now through 0701799 ("upstream ghidra changes"), and the branch merges it:PathAxisCase.hppis identical.PathAxisCaseShort.hppthe branch takes main's version, whose typedef isint. No file uses it.Merge of main 0701799:
OPENSHC_FUNCTION_VISIBILITY_UNITSwas on, so that thefunction-visibility.txtentry takes effect.IgniteFireAtMiniTilemeasures 94.2 / 90.0, both before and after the merge. Without the wrapper unit, the original's reload ofBuildingLayer[tile]aftergetFireEntityIDAtTilebecomes a stack spill.94.2% | 100.0 with OPENSHC_FUNCTION_VISIBILITY_UNITS on. With the option off, every other function measures the same as with it on.Build entries:
cmake/compiler-flags-gl.txt:angleToRotationFrameIndex.cpp,updateProjectileHeightAndCollision.cpp,IgniteFireAtMiniTile.cpp.cmake/function-visibility.txt:OpenSHC::Map::Entities::IgniteFireAtMiniTile->EntityState::getFireEntityIDAtTile.All three entries are the same as in the draft.
Overlap with open PRs:
angleToRotationFrameIndex.cpp. Whichever is merged second will conflict on that file.There is one commit per function. Each sets the function's line in
status/addresses-SHC-3BB0A8C1.txt. There is also one merge of main 592a17d. One more commit adds the build entries.Draft #527 stays open for the remaining 7 functions:
computeLineOfSightDistanceprocessSeaGullsprocessEntityHitBuildingOrUnitUpdateFireEntitymoveProjectileEntitymath_atan_1spawnProjectileEntity🤖 Generated with Claude Code
https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp